package cn.edu.zsc.blms.domain;

import cn.edu.zsc.blms.util.DateUtil;
import com.sun.org.apache.xerces.internal.util.Status;


import java.util.Date;

/**
 * 图书Domain
 *
 * @author 杜烯洋
 */
public class Book extends BaseEntity{

    /**
     * 状态
     */
    public Status status=Status.可出借;
    public enum Status{
        可出借,
        已借出
    }

    /**
     * 书名
     */
    public String name;
    /**
     * 书号
     */
    public String isbn;
    /**
     * 类目
     */
    public String category;
    /**
     * 作者
     */
    public String author;
    /**
     * 出版社
     */
    public String press;
    //TODO：出版日期pulishDate;
    /**
     * 价格
     */
    public Double price;
    /**
     * 是否废弃
     */
    public boolean disabled;
    public Date publishDate;
    public Book(){
    }

    public  Book(int id,String name,String isbn,String category,
                 String author,String press,Date publishDate,Double price){
        this.id = id;
        this.name = name;
        this.isbn =isbn;
        this.category = category;
        this.author =author;
        this.press = press;
        this.publishDate = publishDate;
        this.price = price;
    }
    @Override
    public String toString(){
        return "ID："+id+",书名："+name+",isbn:"+isbn+",类目："+category+",作者："+author+",出版社："+press+",出版日期："+ DateUtil.format(publishDate)
                +",价格："+price+",废弃："+(disabled?"是":"否");
    }
}

